<%= page_title(@usage_limit.new_record? ? "New Kubernetes Limit" : "Edit Kubernetes Limit") %>
<section>
  <%= form_for @usage_limit, html: { class: "form-horizontal" } do |form| %>
    <%= render 'shared/errors', object: @usage_limit %>

    <fieldset>
      <% if DeployGroup.enabled? %>
        <%= form.input :scope_type_and_id, label: "Scope" do %>
          <%= form.select :scope_type_and_id, Environment.env_deploy_group_array(include_all: true), {}, Samson::FormBuilder::LIVE_SELECT_OPTIONS %>
        <% end %>
      <% end %>

      <%= form.input :project_id do %>
        <% projects = Project.with_kubernetes_roles.pluck(:name, :id).unshift ["All", nil] %>
        <%= form.select :project_id, projects, {}, Samson::FormBuilder::LIVE_SELECT_OPTIONS %>
      <% end %>

      <%= form.input :cpu, required: true %>
      <%= form.input :memory, required: true %>

      <%= form.input :comment, as: :text_area %>
    </fieldset>

    <%= form.actions delete: @usage_limit do %>
      | <%= link_to_history @usage_limit if @usage_limit.persisted? %>
    <% end %>
  <% end %>
</section>
